<template>
    <share-form-bo-list-preview
        ref="shareFormBoListPreview"
        :alias="alias"
        :menuId="menuId"
        :single="single"
        :params="params"
        :menuParams="menuParams"
        :secondEdit="secondEdit"
        :formdata="formdata"
        :onload="onload"
        :ctlReadOnly="ctlReadOnly"
        :dialogBox="dialogBox"
        :buttons="buttons"
        :allButtons="allButtons"
        :user="user"
        :appKey="appKey"
        :curApp="curApp"
    ></share-form-bo-list-preview>
</template>

<script>
import {ShareFormBoListPreview} from '@lowcode/jpaas-share-component';
import {mapState} from "pinia";
import useMain from "@/stores/useMain.js";
import useUser from "@/stores/userUser.js";
import DialogBox from "@/assets/js/dialogBox.js";
export default {
    name: "FormBoListPreview",
    inject:['appId'],
    components:{
        ShareFormBoListPreview
    },
    props: {
        //对话框别名
        "alias": {
            type: String
        },
        //菜单ID
        "menuId": {
            type: String
        },
        //是否单选
        "single": {
            type: Boolean,
            default: false
        },
        //参数例如 name=ray&address=guangzhou
        "params": {
            type: String
        },
        //这个是从DialogView打开时需要用到的。
        menuParams: {
            type: String
        },
        //这个预览时不允许二次编辑表单列表
        secondEdit: {
            type: String
        },
        //表单关联数据 {name:"ray"}
        "formdata": {
            type: Object,
            default: () => {
                return {}
            }
        },
        //加载后执行
        "onload": {
            type: Function
        },
        ctlReadOnly: {}
    },
    computed: {
        ...mapState(useMain, ["buttons", "allButtons", "appKey", "curApp"]),
        ...mapState(useUser, ["user"])
    },
    data() {
        return {
            dialogBox: DialogBox,
        }
    },
    created() {
        if(window){
            //给window挂载一个获取当前窗口事件的方法；
            //在ac-admin的列表设计中操作列显示配置的“简易模式”规则中的对话框ActionDialog.vue中使用;
            //如果以后升级admin到vue3可修改掉
            window.GetIframeData = this.GetData
        }
    },
    methods: {
        handParams(params, query, key) {
            this.$refs.shareFormBoListPreview.handParams(params, query, key);
        },
        async init() {
            this.$refs.shareFormBoListPreview.init();
        },
        onCellClick({row,rowIndex}){
            this.$refs.shareFormBoListPreview.$emit("onCellClick", {row,rowIndex});
        },
    },
    watch: {
    }
}
</script>

<style scoped>
.commentBoxs {

}
.commentBoxs >>> .rx-layout {
    padding: 0 !important;

}
</style>
